#include <stdio.h>
#include <conio.h>
#include <dos.h>
int main(void)
{
    int value = 0;
    printf("The current status of your keyboard is:");
    value = peek(0x0040, 0x0017);
    if (value & 1)
        printf("Right shift on");
    else
        printf("Right shift off");
    if (value & 2)
        printf("Left shift on");
    else
        printf("Left shift off");
    if (value & 4)
        printf("Control key on");
    else
        printf("Control key off");
    if (value & 8)
        printf("Alt key on");
    else
        printf("Alt key off");
    if (value & 16)
        printf("Scroll lock on");
    else
        printf("Scroll lock off");
    if (value & 32)
        printf("Num lock on");
    else
        printf("Num lock off");
    if (value & 64)
        printf("Caps lock on");
    else
        printf("Caps lock off");
    return 0;
}